package com.yb.guigu.pick.security.encoder;

import com.yb.guigu.pick.core.constant.EncryptType;
import org.springframework.stereotype.Component;

/**
 * Copyright (C), 2022-2023, 姚兵
 * Author: 32210
 * Date: 2023/6/3 17:41
 * FileName: GuiguNoOpsPasswordEncoder
 * Description:
 */
@Component
public class GuiguNoOpsPasswordEncoder implements GuiguPasswordEncoder {

    @Override
    public boolean support(String encryptedType) {
        return EncryptType.NOOPS.getEncryptedType().equals(encryptedType);
    }


    @Override
    public String encode(CharSequence rawPassword) {
        return rawPassword.toString();
    }


    @Override
    public boolean matches(CharSequence rawPassword, String encodedPassword) {
        return rawPassword.equals(encodedPassword);
    }
}
